package com.bysc.commonutils.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum NoticeStatusEnum {

    READ(1,"已读"),
    UNREAD(2,"未读");


    private final Integer code;
    private final String message;

    /**
     * 根据状态码获取中文
     */
    public static String getMessageBycode(Integer code){
        for (NoticeStatusEnum value : NoticeStatusEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }
}
